package com.xit.hitmouse.Bean;

import android.widget.ImageView;
import android.widget.ProgressBar;

import java.util.Vector;

/**
 * @author 厦工 友敏612
 * @Date 2023/11/22
 */
public class MouseBean {

    private ImageView mouses ;  //老鼠的图片

    private  int hp;  //血量

    private  int type; //选择的模式

    private  int value;  //老鼠的价值  也就是得分

    private  boolean touch;  //是否被点击

    private  ImageView mousesHp;  //老鼠血量图片

    public int getLive() {
        return live;
    }

    private  int  mousePositions;  //老鼠的位置
    private  long liveTime; //创建时间
    private  int  live=3000; //出现时间

    private ProgressBar mouseTime;
    public MouseBean(){
        liveTime = System.currentTimeMillis();
    }
    public int getMousePositions() {
        return mousePositions;
    }

    public void setMousePositions(int mousePositions) {
        this.mousePositions = mousePositions;
    }
    public ImageView getMouses() {
        return mouses;
    }

    public void setMouses(ImageView mouses) {
        this.mouses = mouses;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
        if(type == 1){  //普通地鼠
            this.hp=10;
            this.value=1;
        }
        if(type == 2){  //中等地鼠
            this.hp=20;
            this.value=3;
        }
        if(type == 3){ //受保护地鼠
            this.hp=10;
            this.value=-5;
        }


    }

    public int getHp() {
        return hp;
    }

    public int getValue() {
        return value;
    }

    public boolean isTouch() {
        return touch;
    }

    public void setTouch(boolean touch) {
        this.touch = touch;
    }

    public long getLiveTime() {
        return liveTime;
    }

    public boolean isLive() { //是否还存在
        long currentTime = System.currentTimeMillis(); // 获取当前时间的时间戳
        return   currentTime-liveTime<=live-1000;

    }

    public void reduceHp() {  //减少生命
        this.hp -=10;
    }

    public  boolean isKill(){
        return this.hp<=0 ;
    }

    public ImageView getMousesHp() {
        return mousesHp;
    }

    public void setMousesHp(ImageView mousesHp) {
        this.mousesHp = mousesHp;
    }

    public ProgressBar getMouseTime() {
        return mouseTime;
    }

    public void setMouseTime(ProgressBar mouseTime) {
        this.mouseTime = mouseTime;
    }
}
